

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>milvus.client.types &mdash; pymilvus 1.1.0 documentation</title>
  

  
  
  
  

  
  <script type="text/javascript" src="../../../_static/js/modernizr.min.js"></script>
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script type="text/javascript" src="../../../_static/jquery.js"></script>
        <script type="text/javascript" src="../../../_static/underscore.js"></script>
        <script type="text/javascript" src="../../../_static/doctools.js"></script>
        <script type="text/javascript" src="../../../_static/language_data.js"></script>
        <script type="text/javascript" src="../../../_static/clipboard.min.js"></script>
        <script type="text/javascript" src="../../../_static/copybutton.js"></script>
        <script async="async" type="text/javascript" src="https://assets.readthedocs.org/static/javascript/readthedocs-doc-embed.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    

  
  <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/copybutton.css" type="text/css" />
    <link rel="author" title="About these documents" href="../../../about.html" />
    <link rel="index" title="Index" href="../../../genindex.html" />
    <link rel="search" title="Search" href="../../../search.html" /> 

<!-- RTD Extra Head -->

<link rel="stylesheet" href="https://assets.readthedocs.org/static/css/readthedocs-doc-embed.css" type="text/css" />

<script type="application/json" id="READTHEDOCS_DATA">{"ad_free": false, "api_host": "https://readthedocs.org", "build_date": "2021-06-09T09:23:42Z", "builder": "sphinx", "canonical_url": null, "commit": "73155ea1", "docroot": "/docs/source/", "features": {"docsearch_disabled": false}, "global_analytics_code": "UA-17997319-1", "language": "en", "page": "_modules/milvus/client/types", "programming_language": "py", "project": "pymilvus", "proxied_api_host": "/_", "source_suffix": ".rst", "subprojects": {}, "theme": "sphinx_rtd_theme", "user_analytics_code": "", "version": "latest"}</script>

<!--
Using this variable directly instead of using `JSON.parse` is deprecated.
The READTHEDOCS_DATA global variable will be removed in the future.
-->
<script type="text/javascript">
READTHEDOCS_DATA = JSON.parse(document.getElementById('READTHEDOCS_DATA').innerHTML);
</script>

<script type="text/javascript" src="https://assets.readthedocs.org/static/javascript/readthedocs-analytics.js" async="async"></script>

<!-- end RTD <extrahead> -->
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../../../index.html" class="icon icon-home"> pymilvus
          

          
          </a>

          
            
            
            
              <div class="version">
                latest
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption"><span class="caption-text">Table of Contents</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../install.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../tutorial.html">Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api.html">API reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../param.html">Index</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../results.html">Search results</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../changes.html">Changelog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../faq.html">FAQ</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../contribute.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../about.html">About this documentation</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../index.html">pymilvus</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../../index.html">Docs</a> &raquo;</li>
        
          <li><a href="../../index.html">Module code</a> &raquo;</li>
        
      <li>milvus.client.types</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">

           <div itemprop="articleBody">
            
  <h1>Source code for milvus.client.types</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">enum</span> <span class="kn">import</span> <span class="n">IntEnum</span>


<span class="k">class</span> <span class="nc">Status</span><span class="p">:</span>
    <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">    :attribute code: int (optional) default as ok</span>

<span class="sd">    :attribute message: str (optional) current status message</span>
<span class="sd">    &quot;&quot;&quot;</span>

    <span class="n">SUCCESS</span> <span class="o">=</span> <span class="mi">0</span>
    <span class="n">UNEXPECTED_ERROR</span> <span class="o">=</span> <span class="mi">1</span>
    <span class="n">CONNECT_FAILED</span> <span class="o">=</span> <span class="mi">2</span>
    <span class="n">PERMISSION_DENIED</span> <span class="o">=</span> <span class="mi">3</span>
    <span class="n">COLLECTION_NOT_EXISTS</span> <span class="o">=</span> <span class="mi">4</span>
    <span class="n">ILLEGAL_ARGUMENT</span> <span class="o">=</span> <span class="mi">5</span>
    <span class="n">ILLEGAL_RANGE</span> <span class="o">=</span> <span class="mi">6</span>
    <span class="n">ILLEGAL_DIMENSION</span> <span class="o">=</span> <span class="mi">7</span>
    <span class="n">ILLEGAL_INDEX_TYPE</span> <span class="o">=</span> <span class="mi">8</span>
    <span class="n">ILLEGAL_COLLECTION_NAME</span> <span class="o">=</span> <span class="mi">9</span>
    <span class="n">ILLEGAL_TOPK</span> <span class="o">=</span> <span class="mi">10</span>
    <span class="n">ILLEGAL_ROWRECORD</span> <span class="o">=</span> <span class="mi">11</span>
    <span class="n">ILLEGAL_VECTOR_ID</span> <span class="o">=</span> <span class="mi">12</span>
    <span class="n">ILLEGAL_SEARCH_RESULT</span> <span class="o">=</span> <span class="mi">13</span>
    <span class="n">FILE_NOT_FOUND</span> <span class="o">=</span> <span class="mi">14</span>
    <span class="n">META_FAILED</span> <span class="o">=</span> <span class="mi">15</span>
    <span class="n">CACHE_FAILED</span> <span class="o">=</span> <span class="mi">16</span>
    <span class="n">CANNOT_CREATE_FOLDER</span> <span class="o">=</span> <span class="mi">17</span>
    <span class="n">CANNOT_CREATE_FILE</span> <span class="o">=</span> <span class="mi">18</span>
    <span class="n">CANNOT_DELETE_FOLDER</span> <span class="o">=</span> <span class="mi">19</span>
    <span class="n">CANNOT_DELETE_FILE</span> <span class="o">=</span> <span class="mi">20</span>
    <span class="n">BUILD_INDEX_ERROR</span> <span class="o">=</span> <span class="mi">21</span>
    <span class="n">ILLEGAL_NLIST</span> <span class="o">=</span> <span class="mi">22</span>
    <span class="n">ILLEGAL_METRIC_TYPE</span> <span class="o">=</span> <span class="mi">23</span>
    <span class="n">OUT_OF_MEMORY</span> <span class="o">=</span> <span class="mi">24</span>

    <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">code</span><span class="o">=</span><span class="n">SUCCESS</span><span class="p">,</span> <span class="n">message</span><span class="o">=</span><span class="s2">&quot;Success&quot;</span><span class="p">):</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">code</span> <span class="o">=</span> <span class="n">code</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">message</span> <span class="o">=</span> <span class="n">message</span>

    <span class="k">def</span> <span class="fm">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="n">attr_list</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;</span><span class="si">%s</span><span class="s1">=</span><span class="si">%r</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span>
                     <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__dict__</span><span class="o">.</span><span class="n">items</span><span class="p">()]</span>
        <span class="k">return</span> <span class="s1">&#39;</span><span class="si">%s</span><span class="s1">(</span><span class="si">%s</span><span class="s1">)&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="o">.</span><span class="vm">__name__</span><span class="p">,</span> <span class="s1">&#39;, &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">attr_list</span><span class="p">))</span>

    <span class="k">def</span> <span class="fm">__eq__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Make Status comparable with self by code</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">other</span><span class="p">,</span> <span class="nb">int</span><span class="p">):</span>
            <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">code</span> <span class="o">==</span> <span class="n">other</span>

        <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">other</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">)</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">code</span> <span class="o">==</span> <span class="n">other</span><span class="o">.</span><span class="n">code</span>

    <span class="k">def</span> <span class="fm">__ne__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span>
        <span class="k">return</span> <span class="bp">self</span> <span class="o">!=</span> <span class="n">other</span>

    <span class="k">def</span> <span class="nf">OK</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">code</span> <span class="o">==</span> <span class="n">Status</span><span class="o">.</span><span class="n">SUCCESS</span>


<div class="viewcode-block" id="IndexType"><a class="viewcode-back" href="../../../api.html#milvus.IndexType">[docs]</a><span class="k">class</span> <span class="nc">IndexType</span><span class="p">(</span><span class="n">IntEnum</span><span class="p">):</span>
    <span class="sd">&quot;&quot;&quot;Index type enum.</span>
<span class="sd">    &quot;&quot;&quot;</span>

    <span class="c1">#: Invalid index type.</span>
    <span class="n">INVALID</span> <span class="o">=</span> <span class="mi">0</span>

    <span class="c1">#: FLAT index. See `FLAT &lt;https://milvus.io/docs/v1.0.0/index.md#FLAT&gt;`_.</span>
    <span class="n">FLAT</span> <span class="o">=</span> <span class="mi">1</span>

    <span class="c1">#: IVF(Inverted File) FLAT index.</span>
    <span class="c1">#: See `IVF_FLAT &lt;https://milvus.io/docs/v1.0.0/index.md#IVF_FLAT&gt;`_.</span>
    <span class="n">IVF_FLAT</span> <span class="o">=</span> <span class="mi">2</span>

    <span class="c1">#: IVF SQ8 index. See `IVF_SQ8 &lt;https://milvus.io/docs/v1.0.0/index.md#IVF_SQ8&gt;`_.</span>
    <span class="n">IVF_SQ8</span> <span class="o">=</span> <span class="mi">3</span>

    <span class="c1">#: RNSG(Refined NSG) index. See `RNSG &lt;https://milvus.io/docs/v1.0.0/index.md#RNSG&gt;`_.</span>
    <span class="n">RNSG</span> <span class="o">=</span> <span class="mi">4</span>

    <span class="c1">#: IVF SQ8 Hybrid index. See `IVF_SQ8H &lt;https://milvus.io/docs/v1.0.0/index.md#IVF_SQ8H&gt;`_.</span>
    <span class="n">IVF_SQ8H</span> <span class="o">=</span> <span class="mi">5</span>

    <span class="c1">#: IVF PQ index. See `IVF_PQ &lt;https://milvus.io/docs/v1.0.0/index.md#IVF_PQ&gt;`_.</span>
    <span class="n">IVF_PQ</span> <span class="o">=</span> <span class="mi">6</span>

    <span class="c1">#: HNSW index. See `HNSW &lt;https://milvus.io/docs/v1.0.0/index.md#HNSW&gt;`_.</span>
    <span class="n">HNSW</span> <span class="o">=</span> <span class="mi">11</span>

    <span class="c1">#: ANNOY index. See `ANNOY &lt;https://milvus.io/docs/v1.0.0/index.md#ANNOY&gt;`_.</span>
    <span class="n">ANNOY</span> <span class="o">=</span> <span class="mi">12</span>

    <span class="c1">#: Alternative name for `IVF_FLAT`. Reserved for compatibility.</span>
    <span class="n">IVFLAT</span> <span class="o">=</span> <span class="n">IVF_FLAT</span>
    <span class="c1">#: Alternative name for `IVF_SQ8H`. Reserved for compatibility.</span>
    <span class="n">IVF_SQ8_H</span> <span class="o">=</span> <span class="n">IVF_SQ8H</span>

    <span class="k">def</span> <span class="fm">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">return</span> <span class="s2">&quot;&lt;</span><span class="si">{}</span><span class="s2">: </span><span class="si">{}</span><span class="s2">&gt;&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="o">.</span><span class="vm">__name__</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_name_</span><span class="p">)</span>

    <span class="k">def</span> <span class="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_name_</span></div>


<div class="viewcode-block" id="MetricType"><a class="viewcode-back" href="../../../api.html#milvus.MetricType">[docs]</a><span class="k">class</span> <span class="nc">MetricType</span><span class="p">(</span><span class="n">IntEnum</span><span class="p">):</span>
    <span class="sd">&quot;&quot;&quot;Metric type enum.</span>
<span class="sd">    &quot;&quot;&quot;</span>

    <span class="c1">#: Invalid metric type.</span>
    <span class="n">INVALID</span> <span class="o">=</span> <span class="mi">0</span>

    <span class="c1">#: Euclidean distance. A metric for float vectors.</span>
    <span class="c1">#: See `Euclidean distance &lt;https://milvus.io/docs/v1.0.0/metric.md#Euclidean-distance-L2&gt;`_.</span>
    <span class="n">L2</span> <span class="o">=</span> <span class="mi">1</span>

    <span class="c1">#: Inner product. A metric for float vectors.</span>
    <span class="c1">#: See `Inner Product &lt;https://milvus.io/docs/v1.0.0/metric.md#Inner-product-IP&gt;`_.</span>
    <span class="n">IP</span> <span class="o">=</span> <span class="mi">2</span>

    <span class="c1">#: Hamming distance. A metric for binary vectors.</span>
    <span class="c1">#: See `Hamming distance &lt;https://milvus.io/docs/v1.0.0/metric.md#Hamming-distance&gt;`_.</span>
    <span class="n">HAMMING</span> <span class="o">=</span> <span class="mi">3</span>

    <span class="c1">#: Jaccard distance. A metric for binary vectors.</span>
    <span class="c1">#: See `Jaccard distance &lt;https://milvus.io/docs/v1.0.0/metric.md#Jaccard-distance&gt;`_.</span>
    <span class="n">JACCARD</span> <span class="o">=</span> <span class="mi">4</span>

    <span class="c1">#: Tanimoto distance. A metric for binary vectors.</span>
    <span class="c1">#: See `Tanimoto distance &lt;https://milvus.io/docs/v1.0.0/metric.md#Tanimoto-distance&gt;`_.</span>
    <span class="n">TANIMOTO</span> <span class="o">=</span> <span class="mi">5</span>

    <span class="c1">#: Superstructure. A metric for binary vectors,</span>
    <span class="c1">#: only support :attr:`~milvus.IndexType.FLAT` index.</span>
    <span class="c1">#: See `Superstructure &lt;https://milvus.io/docs/v1.0.0/metric.md#Superstructure&gt;`_.</span>
    <span class="n">SUBSTRUCTURE</span> <span class="o">=</span> <span class="mi">6</span>

    <span class="c1">#: Substructure. A metric for binary vectors, only support :attr:`~milvus.IndexType.FLAT` index.</span>
    <span class="c1">#: See `Substructure &lt;https://milvus.io/docs/v1.0.0/metric.md#Substructure&gt;`_.</span>
    <span class="n">SUPERSTRUCTURE</span> <span class="o">=</span> <span class="mi">7</span>

    <span class="k">def</span> <span class="fm">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">return</span> <span class="s2">&quot;&lt;</span><span class="si">{}</span><span class="s2">: </span><span class="si">{}</span><span class="s2">&gt;&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="o">.</span><span class="vm">__name__</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_name_</span><span class="p">)</span>

    <span class="k">def</span> <span class="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_name_</span></div>
</pre></div>

           </div>
           
          </div>
    <a href="https://github.com/milvus-io/pymilvus">
        <img style="position: absolute; top: 0; right: 0; border: 0;" src="https://github.blog/wp-content/uploads/2008/12/forkme_right_green_007200.png?resize=149%2C149" class="attachment-full size-full" alt="Fork me on GitHub" data-recalc-dims="1">
    </a>

          <footer>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2019-2021 Zilliz. All rights reserved.
      
        <span class="commit">
          Revision <code>73155ea1</code>.
        </span>
      

    </p>
  </div> 

</footer>

        </div>
      </div>

    </section>

  </div>
  

  <div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
    <span class="rst-current-version" data-toggle="rst-current-version">
      <span class="fa fa-book"> Read the Docs</span>
      v: latest
      <span class="fa fa-caret-down"></span>
    </span>
    <div class="rst-other-versions">
      <dl>
        <dt>Versions</dt>
        
          <dd><a href="/en/latest/">latest</a></dd>
        
          <dd><a href="/en/1.1/">1.1</a></dd>
        
          <dd><a href="/en/1.0/">1.0</a></dd>
        
          <dd><a href="/en/0.4.0/">0.4.0</a></dd>
        
          <dd><a href="/en/0.3.0/">0.3.0</a></dd>
        
      </dl>
      <dl>
        <dt>Downloads</dt>
        
          <dd><a href="//pymilvus.readthedocs.io/_/downloads/en/latest/pdf/">pdf</a></dd>
        
          <dd><a href="//pymilvus.readthedocs.io/_/downloads/en/latest/htmlzip/">html</a></dd>
        
          <dd><a href="//pymilvus.readthedocs.io/_/downloads/en/latest/epub/">epub</a></dd>
        
      </dl>
      <dl>
        <dt>On Read the Docs</dt>
          <dd>
            <a href="//readthedocs.org/projects/pymilvus/?fromdocs=pymilvus">Project Home</a>
          </dd>
          <dd>
            <a href="//readthedocs.org/builds/pymilvus/?fromdocs=pymilvus">Builds</a>
          </dd>
      </dl>
      <hr/>
      Free document hosting provided by <a href="http://www.readthedocs.org">Read the Docs</a>.

    </div>
  </div>



  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
   

</body>
</html>